package com.huoyun.car.dao;
import java.util.List;

import com.huoyun.base.dao.BaseDao;
import com.huoyun.car.bean.*;
import com.huoyun.car.dao.evt.QueryCarEvt;
import com.huoyun.car.model.CarDriverOwnerModel;
import com.huoyun.car.model.CarModel;
import com.huoyun.car.model.CarUserCompanyModel;
import com.huoyun.user.bean.User;

public interface CarDao extends BaseDao<Car>{
	public void saveCar(Car car);
	
	public void updateAll(Car car);
	
	public Car getCarById(long carId);
	
	public void delete(long carId);

	public List<Car> getCarListByUserId(long userId);
	
	public List<Car> getUnPublishedCarListByUserId(long userId);
	
	public User getUserByCarId(long carId);
	
//	public List<Car> getCarListByLoadMaxForUser(long userId, String loadMax);
	
	public List<Car> getCarListByUsername(String username);
	
	public String getDriverTelephoneByDriverId(long driverId);
	
	public List<Car> getCarListForCargoByAmount(long userId, String amount, long goodsId);
	
	public CarDriverOwnerModel getCarDriverOwnerModelByCarId(long id);
	
	/**
	 * 根据车牌号查找车辆信息
	 * @param carNumber
	 * @return 车辆信息
	 */
	public Car getCarByCarNumber(String carNumber);
	
	public long queryCarCount(QueryCarEvt queryCarEvt);
	
	/**
	 * 根据用户id获取详细车辆列表
	 * @param userId
	 * @return 详细车辆列表
	 * @author ChengXin
	 */
	public List<CarModel> getCarModelListByUserId(long userId);
	
	
	/**
	 * 获取最新注册的n辆车
	 * @param topN
	 * @return
	 */
	public List<CarUserCompanyModel> getLatestNCar(long topN);
}
